package com.example.jiaju.repository;

import com.example.jiaju.dataobject.UserHost;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface UserHostRepository extends JpaRepository<UserHost,Integer>{

    List<UserHost> findByUserId(String phone);

    UserHost findByUserIdAndHostId(String phone, String IEEE);

    @Query("select userhost from UserHost userhost where hostId=?1 and role<>1")
    List<UserHost> getUsersByIEEE(String IEEE);

}
